package com.health.tablebean;

import com.novabluetooth.services.BluetoothConstant;

import android.text.TextUtils;
import net.tsz.afinal.annotation.sqlite.Id;
import net.tsz.afinal.annotation.sqlite.Table;

@Table(name = "BTDevice")
public class BTDevice {
	@Id(column = "ID")
	private int ID;
	private String name;
	private String macAddress;

	public int getID() {
		return ID;
	}

	public void setID(int iD) {
		ID = iD;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;

	}

	public String getMacAddress() {
		return macAddress;
	}

	public void setMacAddress(String macAddress) {
		this.macAddress = macAddress;
	}


	public boolean equals(Object o) {

		// 如果和自身比较，返回TRUE
		if (this == o)
			return true;
		// 如果不是这个类的实例，返回FALSE
		if (!(o instanceof BTDevice))
			return false;

		final BTDevice u = (BTDevice) o;
		if (TextUtils.isEmpty(this.getName())||TextUtils.isEmpty(this.getMacAddress())||TextUtils.isEmpty(u.getName())||TextUtils.isEmpty(u.getMacAddress())) {
			return false;
		}
		if (this.getName().equals(u.getName())&&this.getMacAddress().equals(u.getMacAddress()))
			return true;
		else
			return false;
	}
	/**
	 * true 4.0
	 * @return
	 * @date 2016年1月8日 下午12:00:30
	 */
	public boolean isVersion4() {
		return !(name.contains("NIBP03") || name.equals(BluetoothConstant.DEVICE_NAME2));
	}

}
